package cn.iocoder.yudao.module.member.dal.mysql.usersharelogs;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.usersharelogs.UserShareLogsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.member.controller.admin.usersharelogs.vo.*;

/**
 * 用户推广日志 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserShareLogsMapper extends BaseMapperX<UserShareLogsDO> {

    default PageResult<UserShareLogsDO> selectPage(UserShareLogsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserShareLogsDO>()
                .betweenIfPresent(UserShareLogsDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(UserShareLogsDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserShareLogsDO::getShareType, reqVO.getShareType())
                .eqIfPresent(UserShareLogsDO::getMoney, reqVO.getMoney())
                .eqIfPresent(UserShareLogsDO::getPoints, reqVO.getPoints())
                .eqIfPresent(UserShareLogsDO::getParentId, reqVO.getParentId())
                .orderByDesc(UserShareLogsDO::getId));
    }

}